<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>Signin Template for Bootstrap</title>

    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">

    <!-- Custom styles for this template -->
    <style>
        html,
        body {height: 100%;}
        body {display: -ms-flexbox;display: -webkit-box;display: flex;-ms-flex-align: center;-ms-flex-pack: center;-webkit-box-align: center;align-items: center;-webkit-box-pack: center;justify-content: center;padding-top: 40px;padding-bottom: 40px;background-color: #f5f5f5;}
        .form-signin {width: 100%;max-width: 330px;padding: 15px;margin: 0 auto;}
        .form-signin .checkbox {font-weight: 400;}
        .form-signin .form-control {position: relative;box-sizing: border-box;height: auto;padding: 10px;font-size: 16px;}
        .form-signin .form-control:focus {z-index: 2;}
        .form-signin input[type="email"] {margin-bottom: -1px;border-bottom-right-radius: 0;border-bottom-left-radius: 0;}
        .form-signin input[type="password"] {margin-bottom: 10px;border-top-left-radius: 0;border-top-right-radius: 0;}
    </style>
</head>

<body class="text-center">
<form class="form-signin" th:action="@{/dologin}" method="post">
    <h1 class="h3 mb-3 font-weight-normal">用户登录</h1>

    <!--如果msg的值为空，则不显示消息-->
    <p style="color: red" th:text="${msg}" th:if="${not #strings.isEmpty(msg)}"></p>
    <input type="email" name="email" id="inputEmail" class="form-control" placeholder="Email address" required autofocus>
    <input type="password" name="password" id="inputPassword" class="form-control" placeholder="Password" required>
    <div class="checkbox mb-3">
        <input type="checkbox" value="remember-me" id="remember"><label for="remember">Remember me</label>
    </div>
    <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
</form>
<script src="js/jquery-1.8.3.min.js"></script>
<script>
    $(function(){
        $('#remember').click(function(e) {
            if($("#remember").is(':checked')){
                console.log($(this).val());
            }else {
                return;
            }
        });
    });
</script>
</body>

</html>